
import '../../../../resource/component/css/component_v2_pc.css'
import '../common/common.scss';

import Vue from 'vue';
import CustomerView from './CustomerView.vue';
import filters from '@src/filter/filter';
import * as mtracker from '../../../util/Mtrackers';
import StatsChartEmpty from '../common/StatsChartEmpty.vue';
import { 
  Popover,
  Table, TableColumn,
  Pagination,
  Tooltip
} from 'element-ui';
import StatsPopverIcon from '../common/StatsPopoverIcon.vue';
import Loading from 'packages/BaseLoading'

import Platform from '@src/util/platform.ts';
import DatePicker from '../common/DataTime.vue'

import { useNewVue } from '@hooks/useNewVue'
const { createVue } = useNewVue()

mtracker.initializeTalkingData();


for(let name in filters) Vue.filter(name, filters[name]);

Vue.component(Popover.name, Popover);
Vue.component(DatePicker.name, DatePicker)
Vue.component(Table.name, Table);
Vue.component(TableColumn.name, TableColumn);
Vue.component(Pagination.name, Pagination);
Vue.component(Tooltip.name, Tooltip);

Vue.component(StatsChartEmpty.name, StatsChartEmpty);
Vue.component(StatsPopverIcon.name, StatsPopverIcon);

Vue.prototype.$platform = Platform;
Vue.prototype.$loading = Loading;
Vue.prototype.$tdOnEvent = mtracker.onEvent;
const componentItem = () => {
  return {
    render(h) {
      return h(CustomerView);
    }
  }
}

Vue.component('async-component', async function(resolve) {
  // 初始化高德地图
  try{
    await __initAmap();
  }catch(err){
    console.warn('amapinit error', err)
  }
  // 需要加loading 打开此注释
  // const instance = Loading.service({ fullscreen: true });
  resolve(componentItem())
  
});

const app = createVue({
  el: '#app',
  render(h) {
    return <async-component />
  }
});

export default app;
